<?php

class DynamicLoadMaterialWarehouseInboundItemsAction extends CAction {
	public function run($token) {
		if (!is_numeric($token)) {
			echo '申购单号不正确：' . $token;
		}
		$criteria = new CDbCriteria();
		$criteria->compare('token', $token);
		$criteria->with = array(
			'warehouseManager',
			'project'
		);
		$models = MaterialWarehouseInbound::model()->findAll($criteria);
		if (empty($models)) {
			echo '没有找到入库单号：' . $token;
		} else {
			$this->getController()
				->renderPartial('_dynamicLoadList', array(
					'models' => $models
				));
		}
	}
}
